package com.firefighting.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.firefighting.dao.TaskItemMapper;
import com.firefighting.entity.TaskItem;

@Service
public class TaskItemService
{
	@Autowired
	private TaskItemMapper taskItemMapper;
	/*Hanjd 删除任务*/
	public int insertSelective(TaskItem taskItem)
	{
		return taskItemMapper.insertSelective(taskItem);
	}
	//Liuxc查询建筑物已下发的contentID
	public List<Integer> getcontentIdInTaskOfBuilding(Integer buildingId) {
		// TODO Auto-generated method stub
		return taskItemMapper.getcontentIdInTaskOfBuilding(buildingId);
	}
	//Hanjd查询一个计划建筑物已下发的contentID
	public List<Integer> getcontentIdInTaskOfBuildingPlan(Integer planId,Integer buildingId) {
		// TODO Auto-generated method stub
		return taskItemMapper.getcontentIdInTaskOfBuildingPlan(planId, buildingId);
	}
	//Hanjd查询一个计划建筑物已完成的contentID
	public List<Integer> getfinishContentIdInTaskOfBuildingPlan(Integer planId,Integer buildingId) {
		// TODO Auto-generated method stub
		return taskItemMapper.getFinishContentIdInTaskOfBuildingPlan(planId, buildingId);
	}
	
	/** zhyan 根据任务id查询该任务中的所有任务项 */
	@SuppressWarnings("rawtypes")
	public List<HashMap> queryTaskItemListByTaskId(int taskId)
	{
		return taskItemMapper.selectTaskItemListByTaskId(taskId);
	}
	
	/** zhyan 根据id查询任务条目 */
	public TaskItem queryTaskItemById(int id )
	{
		return taskItemMapper.selectByPrimaryKey(id);
	}
	
	/** zhyan 根据item id查询item详细信息 */
	@SuppressWarnings("rawtypes")
	public HashMap queryTaskItemInfo(int id)
	{
		return taskItemMapper.selectTaskItemInfoById(id);
	}
	
	/** zhyan 根据任务id查询该任务中所有三级维保内容的id列表  */
	public List<Integer> queryMaintenanceContentIdListByTaskId(int taskId)
	{
		return taskItemMapper.selectMaintenanceContentIdListByTaskId(taskId);
	}
}